package com.worldcup.service.question.calculator;

import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * 球星球队评价题
 * @author duwan.zq
 * @date 2019/03/08
 */
public class AssessCalculator implements AnswerCalculator{

    @Override
    public BigDecimal calHarmony(int score, BigDecimal harmonyWeight, int passiveScore) {
        return new BigDecimal(4 - Math.abs(score - passiveScore) * 2).multiply(harmonyWeight);
    }

    @Override
    public BigDecimal calTopic(int score, BigDecimal topicWeight, int passiveScore) {
        return new BigDecimal(4 - Math.abs(score - passiveScore) * 2).multiply(topicWeight);
    }
}
